package view;

import javax.swing.DefaultListModel;
import javax.swing.JInternalFrame;
import javax.swing.JList;
import javax.swing.ListModel;

import presenter.ILogPresenter;
import presenter.IMapPresenter;
import presenter.LogPresenter;
import presenter.MapPresenter;
import model.LogData;
import model.LogLabel;

public class LogScreen extends JInternalFrame implements ILogView{

	/**
	 
	 */
	private ILogPresenter logPresenter;
	
	private LogScreen() {
		
		logPresenter = new LogPresenter(this);
		
		logPresenter.InitializeLog();
			
	}
	
	public static LogScreen getInstance() {
		return new LogScreen();
	}
	
	@Override
	public void InitializeView(LogData viewData) {
		
		setSize(viewData.getLogWindowWidth(), viewData.getLogWindowHeight());
		setBackground(viewData.getBackgroundColor());
		setClosable(false);
		setResizable(true);
		setMaximizable(true);
		setVisible(true);
		
		JList dataList = new JList(viewData.getLogListModel());
		
		add(dataList);
		
		LogData.addLog(LogLabel.INIT, "LogScreen loaded");	
	}

}
